import QtQuick 1.1
import com.nokia.meego 1.0

SelectionDialog {
    id: singleSelectionDialog
    property bool supportAuto: false
    function reset() {
        load()
    }

    function load(region) {
        listModel.clear()
        var codecList = new Array()
        codecList = engine.availableCodecsForRegion(region)
        console.log("codecList length", codecList.length)
        for (var i = 0; i < codecList.length; i++) {
            console.log("add codec", codecList[i])
            listModel.append({"name": codecList[i]})
        }
    }

    function loadAll() {
        listModel.clear()
        var codecList = new Array()
        codecList = engine.availableCodecs(false)
        console.log("codecList length", codecList.length)
        for (var i = 0; i < codecList.length; i++) {
            console.log("add codec", codecList[i])
            listModel.append({"name": codecList[i]})
        }
    }

    titleText: qsTr("Select Codec")
    selectedIndex: 0

    model: ListModel {
        id: listModel
    }

    Component.onCompleted: {
        load()
    }
}
